package com.cloud.poetry.base.feign.fallback;

import com.cloud.poetry.base.feign.ChatRoomFeignClient;
import com.cloud.poetry.base.feign.fallback.impl.ChatRoomFeignClientImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mengxj
 */
@Component
public class ChatRoomFeignClientFallBack implements FallbackFactory<ChatRoomFeignClient> {

    @Override
    public ChatRoomFeignClient create(Throwable throwable) {
        ChatRoomFeignClientImpl client = new ChatRoomFeignClientImpl();
        client.setThrowable(throwable);
        return client;
    }
}
